home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5485 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.6 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 71 75 | 61 6c 63 6f 6d 6d 2e 63 |Path: qu|alcomm.c|
|00000010| 6f 6d 21 75 73 65 6e 65 | 74 0a 46 72 6f 6d 3a 20 |om!usene|t.From: |
|00000020| 50 61 75 6c 20 57 6f 6c | 66 20 3c 70 77 6f 6c 66 |Paul Wol|f <pwolf|
|00000030| 40 71 75 61 6c 63 6f 6d | 6d 2e 63 6f 6d 3e 0a 4e |@qualcom|m.com>.N|
|00000040| 65 77 73 67 72 6f 75 70 | 73 3a 20 63 6f 6d 70 2e |ewsgroup|s: comp.|
|00000050| 6c 61 6e 67 2e 63 2b 2b | 0a 53 75 62 6a 65 63 74 |lang.c++|.Subject|
|00000060| 3a 20 52 65 3a 20 3f 3f | 3a 52 65 3a 27 53 63 61 |: Re: ??|:Re:'Sca|
|00000070| 6e 66 28 22 25 70 25 2a | 63 22 2c 26 70 29 20 61 |nf("%p%*|c",&p) a|
|00000080| 6e 64 20 4d 65 6d 6f 72 | 79 0a 44 61 74 65 3a 20 |nd Memor|y.Date: |
|00000090| 53 75 6e 2c 20 30 34 20 | 46 65 62 20 31 39 39 36 |Sun, 04 |Feb 1996|
|000000a0| 20 31 39 3a 31 32 3a 30 | 38 20 2d 30 38 30 30 0a | 19:12:0|8 -0800.|
|000000b0| 4f 72 67 61 6e 69 7a 61 | 74 69 6f 6e 3a 20 51 75 |Organiza|tion: Qu|
|000000c0| 61 6c 63 6f 6d 6d 20 49 | 6e 63 2e 0a 4d 65 73 73 |alcomm I|nc..Mess|
|000000d0| 61 67 65 2d 49 44 3a 20 | 3c 33 31 31 35 37 35 38 |age-ID: |<3115758|
|000000e0| 38 2e 36 42 46 45 40 71 | 75 61 6c 63 6f 6d 6d 2e |8.6BFE@q|ualcomm.|
|000000f0| 63 6f 6d 3e 0a 52 65 66 | 65 72 65 6e 63 65 73 3a |com>.Ref|erences:|
|00000100| 20 3c 34 66 33 39 31 74 | 24 32 72 67 40 68 65 72 | <4f391t|$2rg@her|
|00000110| 6d 65 73 2e 6f 61 6e 65 | 74 2e 63 6f 6d 3e 0a 4e |mes.oane|t.com>.N|
|00000120| 4e 54 50 2d 50 6f 73 74 | 69 6e 67 2d 48 6f 73 74 |NTP-Post|ing-Host|
|00000130| 3a 20 61 6e 6e 65 78 2d | 70 32 32 2e 71 75 61 6c |: annex-|p22.qual|
|00000140| 63 6f 6d 6d 2e 63 6f 6d | 0a 4d 69 6d 65 2d 56 65 |comm.com|.Mime-Ve|
|00000150| 72 73 69 6f 6e 3a 20 31 | 2e 30 0a 43 6f 6e 74 65 |rsion: 1|.0.Conte|
|00000160| 6e 74 2d 54 79 70 65 3a | 20 74 65 78 74 2f 70 6c |nt-Type:| text/pl|
|00000170| 61 69 6e 3b 20 63 68 61 | 72 73 65 74 3d 75 73 2d |ain; cha|rset=us-|
|00000180| 61 73 63 69 69 0a 43 6f | 6e 74 65 6e 74 2d 54 72 |ascii.Co|ntent-Tr|
|00000190| 61 6e 73 66 65 72 2d 45 | 6e 63 6f 64 69 6e 67 3a |ansfer-E|ncoding:|
|000001a0| 20 37 62 69 74 0a 58 2d | 4d 61 69 6c 65 72 3a 20 | 7bit.X-|Mailer: |
|000001b0| 4d 6f 7a 69 6c 6c 61 20 | 32 2e 30 62 36 61 20 28 |Mozilla |2.0b6a (|
|000001c0| 57 69 6e 31 36 3b 20 49 | 29 0a 54 6f 3a 20 73 75 |Win16; I|).To: su|
|000001d0| 6e 72 69 73 65 20 3c 73 | 75 6e 72 69 73 65 40 6f |nrise <s|unrise@o|
|000001e0| 61 6e 65 74 2e 63 6f 6d | 3e 0a 0a 73 75 6e 72 69 |anet.com|>..sunri|
|000001f0| 73 65 20 77 72 6f 74 65 | 3a 0a 3e 20 0a 3e 20 20 |se wrote|:.> .> |
|00000200| 48 69 2e 20 20 49 27 6d | 20 77 6f 72 6b 69 6e 67 |Hi. I'm| working|
|00000210| 20 6f 6e 20 61 20 70 72 | 6f 62 6c 65 6d 20 77 68 | on a pr|oblem wh|
|00000220| 69 63 68 20 74 61 6b 65 | 73 20 61 6e 20 61 64 64 |ich take|s an add|
|00000230| 72 65 73 73 20 28 6c 61 | 72 67 65 20 6d 65 6d 6f |ress (la|rge memo|
|00000240| 72 79 20 6d 6f 64 65 6c | 29 0a 3e 20 66 72 6f 6d |ry model|).> from|
|00000250| 20 61 20 75 73 65 72 20 | 61 6e 64 20 64 69 73 70 | a user |and disp|
|00000260| 6c 61 79 73 20 69 74 73 | 20 6d 65 6d 6f 72 79 20 |lays its| memory |
|00000270| 63 6f 6e 74 65 6e 74 73 | 20 69 6e 20 48 65 78 2e |contents| in Hex.|
|00000280| 20 20 49 27 76 65 20 66 | 6f 75 6e 64 20 61 6e 0a | I've f|ound an.|
|00000290| 3e 20 65 78 61 6d 70 6c | 65 20 77 68 69 63 68 20 |> exampl|e which |
|000002a0| 75 73 65 73 20 74 68 65 | 20 66 6f 6c 6f 77 69 6e |uses the| folowin|
|000002b0| 67 20 62 75 74 20 49 20 | 64 6f 6e 27 74 20 75 6e |g but I |don't un|
|000002c0| 64 65 72 73 74 61 6e 64 | 20 74 68 65 20 73 63 61 |derstand| the sca|
|000002d0| 6e 66 2e 0a 3e 20 0a 3e | 20 20 20 20 20 20 20 20 |nf..> .>| |
|000002e0| 20 20 20 20 20 20 20 72 | 65 67 69 73 74 65 72 20 | r|egister |
|000002f0| 69 6e 74 20 69 3b 0a 3e | 20 20 20 20 20 20 20 20 |int i;.>| |
|00000300| 20 20 20 20 20 20 20 75 | 6e 73 69 67 6e 65 64 20 | u|nsigned |
|00000310| 63 68 61 72 20 66 61 72 | 20 2a 70 3b 0a 3e 20 20 |char far| *p;.> |
|00000320| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 75 6e 73 | | uns|
|00000330| 69 67 6e 65 64 20 63 68 | 3b 0a 3e 20 0a 3e 20 20 |igned ch|;.> .> |
|00000340| 20 20 20 20 20 20 20 20 | 73 63 61 6e 66 28 22 25 | |scanf("%|
|00000350| 70 25 2a 63 22 2c 26 70 | 29 3b 0a 3e 20 0a 3e 20 |p%*c",&p|);.> .> |
|00000360| 20 20 20 20 20 20 20 20 | 20 66 6f 72 20 28 69 3d | | for (i=|
|00000370| 31 3b 69 3c 3d 32 35 36 | 3b 69 2b 2b 29 7b 0a 3e |1;i<=256|;i++){.>|
|00000380| 20 20 20 20 20 20 20 20 | 20 20 20 63 68 3d 2a 70 | | ch=*p|
|00000390| 3b 0a 3e 20 20 20 20 20 | 20 20 20 20 20 20 70 72 |;.> | pr|
|000003a0| 69 6e 74 66 28 22 25 30 | 32 78 20 22 2c 63 68 29 |intf("%0|2x ",ch)|
|000003b0| 3b 0a 3e 20 20 20 20 20 | 20 20 20 20 20 20 70 2b |;.> | p+|
|000003c0| 2b 3b 20 20 7d 0a 3e 20 | 0a 3e 20 54 68 65 20 70 |+; }.> |.> The p|
|000003d0| 72 6f 67 72 61 6d 20 64 | 6f 65 73 20 65 73 73 65 |rogram d|oes esse|
|000003e0| 6e 74 69 61 6c 6c 79 20 | 77 68 61 74 20 49 20 77 |ntially |what I w|
|000003f0| 61 6e 74 2c 20 62 75 74 | 20 49 20 6e 65 65 64 20 |ant, but| I need |
|00000400| 74 6f 20 6b 6e 6f 77 2e | 2e 2e 0a 3e 20 57 68 61 |to know.|...> Wha|
|00000410| 74 20 64 6f 65 73 20 74 | 68 65 20 22 25 70 25 2a |t does t|he "%p%*|
|00000420| 63 22 20 77 69 74 68 69 | 6e 20 74 68 65 20 73 63 |c" withi|n the sc|
|00000430| 61 6e 66 20 64 6f 3f 3f | 3f 20 20 48 6f 77 20 64 |anf do??|? How d|
|00000440| 6f 65 73 20 69 74 20 77 | 6f 72 6b 3f 3f 3f 0a 3e |oes it w|ork???.>|
|00000450| 20 41 6c 73 6f 20 68 6f | 77 20 63 61 6e 20 49 20 | Also ho|w can I |
|00000460| 69 6e 63 72 65 6d 65 6e | 74 20 74 68 65 20 70 20 |incremen|t the p |
|00000470| 70 6f 69 6e 74 65 72 20 | 73 6f 20 74 68 61 74 20 |pointer |so that |
|00000480| 74 68 65 20 73 65 67 6d | 65 6e 74 20 69 6e 63 72 |the segm|ent incr|
|00000490| 65 61 63 65 73 0a 3e 20 | 61 6e 64 20 6e 6f 74 20 |eaces.> |and not |
|000004a0| 6a 75 73 74 20 74 68 65 | 20 6f 66 66 73 65 74 20 |just the| offset |
|000004b0| 28 61 73 20 74 68 65 20 | 61 62 6f 76 65 20 65 78 |(as the |above ex|
|000004c0| 61 6d 70 6c 65 20 64 6f | 65 73 29 2e 0a 3e 20 0a |ample do|es)..> .|
|000004d0| 3e 20 2d 53 75 6e 72 69 | 73 65 0a 0a 41 73 73 75 |> -Sunri|se..Assu|
|000004e0| 6d 69 6e 67 20 66 72 6f | 6d 20 74 68 65 20 72 65 |ming fro|m the re|
|000004f0| 66 65 72 65 6e 63 65 20 | 74 6f 20 22 6d 65 6d 6f |ference |to "memo|
|00000500| 72 79 20 6d 6f 64 65 6c | 22 20 74 68 61 74 20 69 |ry model|" that i|
|00000510| 74 20 69 73 20 61 20 4d | 69 63 72 6f 73 6f 66 74 |t is a M|icrosoft|
|00000520| 20 38 30 78 38 36 20 0a | 63 6f 6d 70 69 6c 65 72 | 80x86 .|compiler|
|00000530| 2c 20 79 6f 75 20 61 72 | 65 20 74 72 79 69 6e 67 |, you ar|e trying|
|00000540| 20 74 6f 20 73 63 61 6e | 20 61 20 66 61 72 20 70 | to scan| a far p|
|00000550| 6f 69 6e 74 65 72 20 28 | 33 32 20 62 69 74 29 20 |ointer (|32 bit) |
|00000560| 76 61 6c 75 65 20 77 69 | 74 68 20 25 70 22 20 0a |value wi|th %p" .|
|00000570| 77 68 69 63 68 20 64 65 | 73 63 72 69 62 65 73 20 |which de|scribes |
|00000580| 61 20 31 36 20 62 69 74 | 20 76 61 6c 75 65 20 74 |a 16 bit| value t|
|00000590| 6f 20 63 6f 6e 76 65 72 | 74 2c 20 73 6f 20 79 6f |o conver|t, so yo|
|000005a0| 75 20 6f 6e 6c 79 20 70 | 72 69 6e 74 20 74 68 65 |u only p|rint the|
|000005b0| 20 6c 6f 77 20 6f 72 64 | 65 72 20 0a 31 36 20 62 | low ord|er .16 b|
|000005c0| 69 74 73 20 6f 66 20 74 | 68 65 20 70 6f 69 6e 74 |its of t|he point|
|000005d0| 65 72 2e 20 54 72 79 20 | 75 73 69 6e 67 20 22 25 |er. Try |using "%|
|000005e0| 6c 70 22 20 69 6e 73 74 | 65 61 64 2e 20 41 6c 73 |lp" inst|ead. Als|
|000005f0| 6f 2c 20 66 6f 72 20 61 | 20 66 61 72 20 70 6f 69 |o, for a| far poi|
|00000600| 6e 74 65 72 2c 20 0a 74 | 68 65 20 70 6f 69 6e 74 |nter, .t|he point|
|00000610| 65 72 20 61 72 69 74 68 | 6d 65 74 69 63 20 69 73 |er arith|metic is|
|00000620| 20 6d 6f 64 75 6c 6f 20 | 31 36 20 62 69 74 73 2e | modulo |16 bits.|
|00000630| 20 49 66 20 79 6f 75 20 | 77 61 6e 74 20 33 32 2d | If you |want 32-|
|00000640| 62 69 74 20 70 6f 69 6e | 74 65 72 20 0a 61 72 69 |bit poin|ter .ari|
|00000650| 74 68 6d 65 74 69 63 2c | 20 64 65 63 6c 61 72 65 |thmetic,| declare|
|00000660| 20 74 68 65 20 70 6f 69 | 6e 74 65 72 20 61 73 20 | the poi|nter as |
|00000670| 22 63 68 61 72 20 5f 68 | 75 67 65 20 2a 22 0a 2d |"char _h|uge *".-|
|00000680| 2d 0a | |-. | |
+--------+-------------------------+-------------------------+--------+--------+